Xbasic

NTH_DOW Function

Syntax

Formatted_Date as C = nth_dow(C dayName ,N month ,N year ,N occurrence )

Arguments

dayName

Case insensitive English name or abbreviation for the day of the week.

month

1 (January) through 12 (December)

year

Four digit year (1998). Numeric

occurrence

A positive integer. Numeric

Description

Finds the date for the 'n'th day in a month. e.g. the 4th Thursday for November in 2005

Discussion

NTH_DOW() returns the date for the Nth occurrence of the specified day of the week starting in the specified month and year.

Example

dim cs as C
cs = nth_dow("friday", 12, 1999, 2)
cs   ->   "{12/10/1999}"
cs = nth_dow("friday", 12, 1999, 8)
cs   ->   "{01/21/2000}"
cs = nth_dow("mon",12,2002,0)
cs   -> " { / / }"

See Also